<?php

/**
 * Zonebosslist form base class.
 *
 * @method Zonebosslist getObject() Returns the current form's model object
 *
 * @package    raidpoints
 * @subpackage form
 * @author     David Driscoll
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseZonebosslistForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
      'zoneid'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Zone'), 'add_empty' => false)),
      'sort'       => new sfWidgetFormInputText(),
      'name'       => new sfWidgetFormInputText(),
      'shortname1' => new sfWidgetFormInputText(),
      'shortname2' => new sfWidgetFormInputText(),
      'shortname3' => new sfWidgetFormInputText(),
      'header'     => new sfWidgetFormInputText(),
      'headersort' => new sfWidgetFormInputText(),
      'shown'      => new sfWidgetFormInputCheckbox(),
      'killdate'   => new sfWidgetFormInputText(),
      'screenshot' => new sfWidgetFormInputText(),
      'topic'      => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'         => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'zoneid'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Zone'))),
      'sort'       => new sfValidatorInteger(),
      'name'       => new sfValidatorString(array('max_length' => 100)),
      'shortname1' => new sfValidatorString(array('max_length' => 50)),
      'shortname2' => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'shortname3' => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'header'     => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'headersort' => new sfValidatorInteger(array('required' => false)),
      'shown'      => new sfValidatorBoolean(array('required' => false)),
      'killdate'   => new sfValidatorInteger(array('required' => false)),
      'screenshot' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'topic'      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorDoctrineUnique(array('model' => 'Zonebosslist', 'column' => array('zoneid', 'name')))
    );

    $this->widgetSchema->setNameFormat('zonebosslist[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Zonebosslist';
  }

}
